/*
 * MIT License
 *
 * Copyright (c) 2025 Mark·虎
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 *
 */

package com.hsxxherp.key.support.model.entity;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.List;

@Data
@Schema(name = "group_condition", description = "根分组条件，用于定义查询的分组逻辑")
public class GroupCondition {
    /**
     * 一组查询条件
     */
    @Schema(name = "conditions", description = "一组查询条件，每个条件由 QueryCondition 类定义，用于构建查询逻辑")
    private List<QueryCondition> conditions;
    /**
     * 组内条件的逻辑关系，如 "and"（且）、"or"（或）
     */
    @Schema(name = "logic", description = "组内条件之间的逻辑关系，可选值为 'and' 表示且关系，'or' 表示或关系")
    private String logic;
    /**
     * 子分组条件
     */
    @Schema(name = "sub_groups", description = "当前分组下的子分组条件，每个子分组也是一个 GroupCondition 实例，用于构建更复杂的查询逻辑")
    private List<GroupCondition> subGroups;
    /**
     * 该组与其他组之间的逻辑关系，如 "and", "or"
     */
    @Schema(name = "group_logic", description = "当前分组与其他分组之间的逻辑关系，可选值为 'and' 或 'or'，用于组合不同分组的查询条件")
    private String groupLogic;
}